package com.yesep.learn.netty.tcp.protocol.impl.hj212_2017.command;

import com.yesep.learn.netty.tcp.protocol.common.CN_OPT;
import com.yesep.learn.netty.tcp.protocol.common.Constants;
import com.yesep.learn.netty.tcp.protocol.common.SYS_TYPE;
import com.yesep.learn.netty.tcp.protocol.exception.CommandParseException;
import com.yesep.learn.netty.tcp.protocol.session.Command;

/**
 * @Description: 执行结果
 */
public class Cmd9012 extends Command {

	public Cmd9012() {
	}

	public Cmd9012(String msg) throws CommandParseException {
		super(msg);
	}

	public Cmd9012(String ST, String PW, String MN, Integer Flag, Integer ExeRtn) {
		super(SYS_TYPE.INTERACTIVE.getCode(), CN_OPT._9012.getCode(), PW, MN, Flag);
		this.setExeRtn(ExeRtn);
	}

	public Integer getExeRtn() {
		String code = this.getCP().getParam(Constants.PARAM_ExeRtn);
		if (null != code) {
			return Integer.valueOf(code);
		}
		return 0;
	}

	public void setExeRtn(Integer code) {
		this.getCP().addParam(Constants.PARAM_ExeRtn, String.valueOf(code));
	}
}
